﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace ManYan.EFCore.Migrations
{
    public partial class _20221102 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<DateTime>(
                name: "CreatDateTime",
                table: "tb_exam_content",
                type: "datetime(6)",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn<Guid>(
                name: "CreateUserId",
                table: "tb_exam_content",
                type: "char(36)",
                nullable: false,
                defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
                collation: "ascii_general_ci");

            migrationBuilder.AddColumn<string>(
                name: "CreateUserName",
                table: "tb_exam_content",
                type: "varchar(50)",
                maxLength: 50,
                nullable: false,
                defaultValue: "")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "tb_exam_content",
                type: "tinyint(1)",
                nullable: false,
                defaultValue: false);

            migrationBuilder.CreateTable(
                name: "tb_user_refresh_token",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    UserId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
                    Token = table.Column<string>(type: "longtext", nullable: false)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    ValidDate = table.Column<DateTime>(type: "datetime(6)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_tb_user_refresh_token", x => x.Id);
                })
                .Annotation("MySql:CharSet", "utf8mb4");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "tb_user_refresh_token");

            migrationBuilder.DropColumn(
                name: "CreatDateTime",
                table: "tb_exam_content");

            migrationBuilder.DropColumn(
                name: "CreateUserId",
                table: "tb_exam_content");

            migrationBuilder.DropColumn(
                name: "CreateUserName",
                table: "tb_exam_content");

            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "tb_exam_content");
        }
    }
}
